package com.ty.day2;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/15 15:54
 */
public class Demo01 {
    public static void main(String[] args) {
        People d1 = new Doctor();
        People p1 = new Police();
        d1.study();
        p1.eat();
        People people = new People();
        Doctor doctor = new Doctor();

        Police police = new Police();
//        people=doctor;//子给父——ok其他的都是错
//        police=doctor;
//        doctor=people;

//        System.out.println(people.getClass()== Doctor.class);
//        System.out.println(p1.getClass());
//        System.out.println(people.getClass());
//        System.out.println(doctor.getClass());
//        System.out.println(police.getClass());
//        System.out.println(People.class);
//        System.out.println(Doctor.class);
//        System.out.println(Police.class);
    }
}
